#include "widget.h"
#include "ui_widget.h"
#include "maskwidget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    ui->widget->setStyleSheet("background-color: rgb(200,0,0)");
    //第一步,设置需要遮罩的父窗体
    MaskWidget::Instance()->setMainWidget(ui->widget);

    //第二步,设置哪些弹窗窗体需要被遮罩
    QStringList dialogNames;
    dialogNames << "frm1" << "frm2";
    MaskWidget::Instance()->setDialogNames(dialogNames);
}


void Widget::on_pushButton_clicked()
{
    MaskWidget::Instance()->show();
}

Widget::~Widget()
{
    delete ui;
}
